package spring.my.db.sharding.demo.response;

import spring.my.db.sharding.demo.utils.PageAvailable;

import java.util.Collections;
import java.util.List;

public class Page<T> {
    private int pageNo;
    private int pageSize;
    private List<T> result;
    private int count;

    public Page() {
    }

    public Page(PageAvailable page) {
        this.pageNo = page.getPageNo();
        this.pageSize = page.getPageSize();
        this.result = Collections.emptyList();
    }

    public int getPageNo() {
        return pageNo;
    }

    public void setPageNo(int pageNo) {
        this.pageNo = pageNo;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public List<T> getResult() {
        return result;
    }

    public void setResult(List<T> result) {
        this.result = result;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }
}
